81cf4ba2fb579d79d4a2346a8f979396ca8761e1,findbugs/src/java/edu/umd/cs/findbugs/detect/RuntimeExceptionCapture.java,RuntimeExceptionCapture,visitCode,#Code#,95

Before Change


			CaughtException caughtException = (CaughtException) iterator.next();
			for (Iterator iterator1 = throwList.iterator(); iterator1.hasNext();) {
				ThrownException thrownException = (ThrownException) iterator1.next();
				if (thrownException.exceptionClass.equals(caughtException.exceptionClass)
						&& thrownException.offset >= caughtException.startOffset
				        && thrownException.offset < caughtException.endOffset) {
					caughtException.seen = true;
					break;
				}
			}
			if (caughtException.exceptionClass.equals("java.lang.Exception") && !caughtException.seen) {
				// Now we have a case where Exception is caught, but not thrown

After Change



		for (Iterator iterator = catchList.iterator(); iterator.hasNext();) {
			CaughtException caughtException = (CaughtException) iterator.next();
			Set<String> thrownSet = new HashSet<String>();
			for (Iterator iterator1 = throwList.iterator(); iterator1.hasNext();) {
				ThrownException thrownException = (ThrownException) iterator1.next();
				if (thrownException.offset >= caughtException.startOffset
				        && thrownException.offset < caughtException.endOffset) {
				    thrownSet.add(thrownException.exceptionClass);
				    if (thrownException.exceptionClass.equals(caughtException.exceptionClass))
					caughtException.seen = true;
				}